﻿package core.ui
{
    import core.manager.*;
    import core.ui.controls.*;
    import flash.display.*;
    import flash.events.*;

    public class Menubar extends Sprite
    {
        private var ed:Tuyitu;
        private var cm:CommandManager;
        private var bg:Bitmap;
        private var user:Sprite;
        public var file:Menu;
        public var edit:Menu;
        public var image:Menu;
        public var layer:Menu;
        public var adjustment:Menu;
        public var filter:Menu;
        public var view:Menu;
        public var help:Menu;
        public var language:Menu;
        public var liping:Menu;
        public var fullscreen:Menu;
        var active:Boolean = false;

        public function Menubar(param1:Tuyitu)
        {
            var ed:*;
            var _arg1:* = param1;
            ed = _arg1;
            this.ed = ed;
            this.cm = ed.cm;
            this.bg = new Bitmap(new Menubarbg());
            addChild(this.bg);
            var cx:*;
            var filet:* = new MenuTitle("rm_file", "file");
            filet.addEventListener(MouseEvent.MOUSE_DOWN, this.MenuTitleMouseDown, false, 0, true);
            filet.addEventListener(MouseEvent.ROLL_OVER, this.MenuTitleMouseOver, false, 0, true);
            filet.x = cx;
            filet.y = 1;
            cx = cx + (filet.width + 3);
            addChild(filet);
            var editt:* = new MenuTitle("rm_edit", "edit");
            editt.addEventListener(MouseEvent.MOUSE_DOWN, this.MenuTitleMouseDown, false, 0, true);
            editt.addEventListener(MouseEvent.ROLL_OVER, this.MenuTitleMouseOver, false, 0, true);
            editt.x = cx;
            editt.y = 1;
            cx = cx + (editt.width + 3);
            addChild(editt);
            var imaget:* = new MenuTitle("rm_image", "image");
            imaget.addEventListener(MouseEvent.MOUSE_DOWN, this.MenuTitleMouseDown, false, 0, true);
            imaget.addEventListener(MouseEvent.ROLL_OVER, this.MenuTitleMouseOver, false, 0, true);
            imaget.x = cx;
            imaget.y = 1;
            cx = cx + (imaget.width + 3);
            addChild(imaget);
            var layert:* = new MenuTitle("rm_layer", "layer");
            layert.addEventListener(MouseEvent.MOUSE_DOWN, this.MenuTitleMouseDown, false, 0, true);
            layert.addEventListener(MouseEvent.ROLL_OVER, this.MenuTitleMouseOver, false, 0, true);
            layert.x = cx;
            layert.y = 1;
            cx = cx + (layert.width + 3);
            addChild(layert);
            var adjustmentt:* = new MenuTitle("rm_adjustment", "adjustment");
            adjustmentt.addEventListener(MouseEvent.MOUSE_DOWN, this.MenuTitleMouseDown, false, 0, true);
            adjustmentt.addEventListener(MouseEvent.ROLL_OVER, this.MenuTitleMouseOver, false, 0, true);
            adjustmentt.x = cx;
            adjustmentt.y = 1;
            cx = cx + (adjustmentt.width + 3);
            addChild(adjustmentt);
            var filtert:* = new MenuTitle("rm_filter", "filter");
            filtert.addEventListener(MouseEvent.MOUSE_DOWN, this.MenuTitleMouseDown, false, 0, true);
            filtert.addEventListener(MouseEvent.ROLL_OVER, this.MenuTitleMouseOver, false, 0, true);
            filtert.x = cx;
            filtert.y = 1;
            cx = cx + (filtert.width + 3);
            addChild(filtert);
            var viewt:* = new MenuTitle("rm_view", "view");
            viewt.addEventListener(MouseEvent.MOUSE_DOWN, this.MenuTitleMouseDown, false, 0, true);
            viewt.addEventListener(MouseEvent.ROLL_OVER, this.MenuTitleMouseOver, false, 0, true);
            viewt.x = cx;
            viewt.y = 1;
            cx = cx + (viewt.width + 3);
            addChild(viewt);
            var languaget:* = new MenuTitle("rm_language", "language");
            languaget.addEventListener(MouseEvent.MOUSE_DOWN, this.MenuTitleMouseDown, false, 0, true);
            languaget.addEventListener(MouseEvent.ROLL_OVER, this.MenuTitleMouseOver, false, 0, true);
            languaget.x = cx;
            languaget.y = 1;
            cx = cx + (languaget.width + 3);
            addChild(languaget);
            var fullscreen:* = new MenuTitle("rm_fullscreen_mode", "fullscreen");
            fullscreen.y = 1;
            fullscreen.x = cx;
            cx = cx + (fullscreen.width + 3);
            fullscreen.addEventListener(MouseEvent.MOUSE_DOWN, this.cm.ToggleFullScreenMode);
            addChild(fullscreen);
            var lipingt:* = new MenuTitle("rm_liping", "liping");
            lipingt.addEventListener(MouseEvent.MOUSE_DOWN, this.MenuTitleMouseDown, false, 0, true);
            lipingt.addEventListener(MouseEvent.ROLL_OVER, this.MenuTitleMouseOver, false, 0, true);
            lipingt.x = cx;
            lipingt.y = 1;
            cx = cx + (lipingt.width + 3);
            addChild(lipingt);
            this.file = new Menu();
            this.file.x = filet.x;
            this.file.y = 22;
            this.file.visible = false;
            if (!U.IsParamTrue("single"))
            {
                this.file.AddItem(this.cm.NewImage, "rm_new_image", true, "Ctrl + N");
                this.file.AddItem(this.cm.OpenImage, "rm_open_image", true, "Ctrl + O");
                this.file.AddItem(this.cm.OpenImageFrom, "rm_open_from_url", true);
                this.file.AddItem(function ()
            {
                cm.OpenImage(true);
                return;
            }// end function
            , "rm_open_image_as_layer");
                if (!U.IsParamTrue("locktarget"))
                {
                    this.file.AddItem(this.cm.OpenImageLibrary, "rm_open_from_library", true);
                }
                this.file.AddSeparator();
            }
            this.file.AddItem(this.cm.SaveImage, "rm_save", true, "Ctrl + S");
            this.file.AddItem(this.cm.PrintImage, "rm_print", true);
            this.file.AddItem(this.cm.ConfirmClose, "rm_close", false, "Ctrl + W");
            if (!U.IsParamTrue("locktarget"))
            {
                this.file.AddSeparator();
                this.file.AddItem(this.cm.Login, "rm_login", true);
                this.file.AddItem(this.cm.Register, "rm_register", true);
                this.file.AddItem(this.cm.LogoutUser, "rm_logout", false, "", false);
            }
            this.file.AddSeparator();
            this.file.AddItem(this.cm.Exit, "rm_exit", false, "Ctrl + Q");
            addChild(this.file);
            this.edit = new Menu();
            this.edit.x = editt.x;
            this.edit.y = 22;
            this.edit.visible = false;
            this.edit.AddItem(this.cm.Undo, "rm_undo", false, "Ctrl + Z");
            this.edit.AddItem(this.cm.Redo, "rm_redo", false, "Ctrl + Y");
            this.edit.AddSeparator();
            this.edit.AddItem(this.cm.Cut, "rm_cut", false, "Ctrl + X");
            this.edit.AddItem(this.cm.Copy, "rm_copy", false, "Ctrl + C");
            this.edit.AddItem(this.cm.Clear, "rm_clear", false, "DEL");
            this.edit.AddItem(this.cm.Paste, "rm_paste", false, "Ctrl + V");
            this.edit.AddSeparator();
            this.edit.AddItem(this.cm.FreeTransform, "rm_free_transform", true, "Ctrl + T");
            this.edit.AddItem(this.cm.FreeDistort, "rm_free_distort", true);
            this.edit.AddSeparator();
            this.edit.AddItem(this.cm.SelectAll, "rm_select_all", false, "Ctrl + A");
            this.edit.AddItem(this.cm.DeselectAll, "rm_deselect_all", false, "Ctrl + D");
            this.edit.AddItem(this.cm.InvertSelection, "rm_invert_selection");
            this.edit.AddSeparator();
            this.edit.AddItem(this.cm.DefineBrush, "rm_define_brush", false, "Ctrl + K");
            addChild(this.edit);
            this.image = new Menu();
            this.image.x = imaget.x;
            this.image.y = 22;
            this.image.visible = false;
            this.image.AddItem(this.cm.ImageSize, "rm_image_size", true);
            this.image.AddItem(this.cm.CanvasSize, "rm_canvas_size", true);
            this.image.AddSeparator();
            this.image.AddItem(this.cm.RotateCanvas180, "rm_rotate_canvas_180");
            this.image.AddItem(this.cm.RotateCanvas90CW, "rm_rotate_canvas_90_cw");
            this.image.AddItem(this.cm.RotateCanvas90CCW, "rm_rotate_canvas_90_ccw");
            this.image.AddSeparator();
            this.image.AddItem(this.cm.FlipCanvasVertical, "rm_flip_canvas_vertical");
            this.image.AddItem(this.cm.FlipCanvasHorizontal, "rm_flip_canvas_horizontal");
            this.image.AddSeparator();
            this.image.AddItem(this.cm.Crop, "rm_crop");
            addChild(this.image);
            this.layer = new Menu();
            this.layer.x = layert.x;
            this.layer.y = 22;
            this.layer.visible = false;
            this.layer.AddItem(this.cm.NewLayer, "rm_new_layer");
            this.layer.AddItem(this.cm.DuplicateLayer, "rm_duplicate_layer");
            this.layer.AddItem(this.cm.DeleteLayer, "rm_delete_layer");
            this.layer.AddSeparator();
            this.layer.AddItem(function ()
            {
                cm.OpenImage(true);
                return;
            }// end function
            , "rm_open_image_as_layer");
            this.layer.AddItem(function ()
            {
                cm.OpenImageFrom(true);
                return;
            }// end function
            , "rm_open_url_as_layer");
            this.layer.AddItem(function ()
            {
                cm.OpenImageLibrary(true);
                return;
            }// end function
            , "rm_open_library_as_layer");
            this.layer.AddSeparator();
            this.layer.AddItem(this.cm.MergeLayerDown, "rm_merge_down");
            this.layer.AddItem(this.cm.MergeVisibleLayers, "rm_merge_visible");
            this.layer.AddItem(this.cm.FlattenImage, "rm_flatten_image");
            this.layer.AddSeparator();
            this.layer.AddItem(this.cm.OrderLayerUp, "rm_move_layer_up");
            this.layer.AddItem(this.cm.OrderLayerDown, "rm_move_layer_down");
            this.layer.AddSeparator();
            this.layer.AddItem(this.cm.ShowLayerStyle, "rm_layer_style", true);
            this.layer.AddItem(this.cm.RasterizeType, "rm_rasterize_layer");
            this.layer.AddSeparator();
            this.layer.AddItem(this.cm.AddLayerMask, "rm_add_layer_mask");
            this.layer.AddItem(this.cm.DeleteLayerMask, "rm_delete_layer_mask");
            this.layer.AddItem(this.cm.ApplyLayerMask, "rm_apply_layer_mask");
            this.layer.AddSeparator();
            this.layer.AddItem(this.cm.RotateLayer180, "rm_rotate_layer_180");
            this.layer.AddItem(this.cm.RotateLayer90CW, "rm_rotate_layer_90_cw");
            this.layer.AddItem(this.cm.RotateLayer90CCW, "rm_rotate_layer_90_ccw");
            this.layer.AddSeparator();
            this.layer.AddItem(this.cm.FlipLayerVertical, "rm_flip_layer_vertical");
            this.layer.AddItem(this.cm.FlipLayerHorizontal, "rm_flip_layer_horizontal");
            addChild(this.layer);
            this.adjustment = new Menu();
            this.adjustment.x = adjustmentt.x;
            this.adjustment.y = 22;
            this.adjustment.visible = false;
            this.adjustment.AddItem(this.cm.BrightnessContrast, "rm_brightness_contrast", true);
            this.adjustment.AddItem(this.cm.HueSaturation, "rm_hue_saturation", true, "Ctrl + U");
            this.adjustment.AddItem(this.cm.Levels, "rm_levels", true, "Ctrl + L");
            this.adjustment.AddItem(this.cm.Curves, "rm_curves", true, "Ctrl + M");
            this.adjustment.AddItem(this.cm.Exposure, "rm_exposuree", true);
            this.adjustment.AddSeparator();
            this.adjustment.AddItem(this.cm.AutoLevels, "rm_auto_levels");
            this.adjustment.AddSeparator();
            this.adjustment.AddItem(this.cm.Invert, "rm_invert", false, "Ctrl + I");
            this.adjustment.AddItem(this.cm.Sepia, "rm_sepia");
            this.adjustment.AddItem(this.cm.Solarize, "rm_solarize");
            this.adjustment.AddItem(this.cm.Desaturate, "rm_desaturate");
            this.adjustment.AddItem(this.cm.OldPhoto, "rm_old_photo");
            this.adjustment.AddItem(this.cm.CrossProcess, "rm_cross_process");
            this.adjustment.AddItem(this.cm.Threshold, "rm_threshold", true);
            this.adjustment.AddItem(this.cm.Posterize, "rm_posterize", true);
            this.adjustment.AddItem(this.cm.ColorLookup, "rm_color_lookup", true);
            addChild(this.adjustment);
            this.filter = new Menu();
            this.filter.x = filtert.x;
            this.filter.y = 22;
            this.filter.visible = false;
            this.filter.AddItem(this.cm.Blur, "rm_blur");
            this.filter.AddItem(this.cm.BoxBlur, "rm_box_blur", true);
            this.filter.AddItem(this.cm.GaussianBlur, "rm_gaussian_blur", true);
            this.filter.AddItem(this.cm.Sharpen, "rm_sharpen");
            this.filter.AddItem(this.cm.UnsharpMask, "rm_unsharp_mask", true);
            this.filter.AddItem(this.cm.Denoise, "rm_denoise");
            this.filter.AddSeparator();
            this.filter.AddItem(this.cm.Noise, "rm_noise", true);
            this.filter.AddItem(this.cm.Diffuse, "rm_diffuse", true);
            this.filter.AddItem(this.cm.Scanlines, "rm_scanlines", true);
            this.filter.AddItem(this.cm.Halftone, "rm_halftone", true);
            this.filter.AddItem(this.cm.Pixelate, "rm_pixelate", true);
            this.filter.AddItem(this.cm.Pointinize, "rm_pointinize", true);
            this.filter.AddItem(this.cm.Waterswirl, "rm_water_swirl", true);
            this.filter.AddItem(this.cm.PolarCoordinates, "rm_polar_coordinates", true);
            this.filter.AddItem(this.cm.Kaleidoscope, "rm_kaleidoscope", true);
            this.filter.AddItem(this.cm.TiltShift, "rm_tilt_shift", true);
            this.filter.AddSeparator();
            this.filter.AddItem(this.cm.Vignette, "rm_vignette", true);
            this.filter.AddItem(this.cm.Pastel, "rm_pastel", true);
            this.filter.AddItem(this.cm.GlamourGlow, "rm_glamour_glow");
            this.filter.AddItem(this.cm.MimicHDR, "rm_mimic_hdr");
            this.filter.AddItem(this.cm.Hope, "rm_hope");
            this.filter.AddItem(this.cm.ArtPoster, "rm_art_poster", true);
            this.filter.AddItem(this.cm.Heatmap, "rm_heatmap", true);
            this.filter.AddItem(this.cm.TriTone, "rm_tritone", true);
            this.filter.AddSeparator();
            this.filter.AddItem(this.cm.Emboss, "rm_emboss");
            this.filter.AddItem(this.cm.Engrave, "rm_engrave");
            this.filter.AddItem(this.cm.FindEdges, "rm_find_edges");
            addChild(this.filter);
            this.view = new Menu();
            this.view.x = viewt.x;
            this.view.y = 22;
            this.view.visible = false;
            this.view.AddItem(this.cm.ZoomIn, "rm_zoom_in", false, "Ctrl + +");
            this.view.AddItem(this.cm.ZoomOut, "rm_zoom_out", false, "Ctrl + -");
            this.view.AddItem(this.cm.ZoomActualPixels, "rm_actual_pixels", false, "Ctrl + 0");
            this.view.AddItem(this.cm.ZoomShowAll, "rm_show_all");
            this.view.AddSeparator();
            this.view.AddItem(this.cm.ShowHideNavigator, "rm_navigator");
            this.view.AddItem(this.cm.ShowHideLayers, "rm_layers");
            this.view.AddItem(this.cm.ShowHideHistory, "rm_history");
            this.view.AddItem(this.cm.ShowHideOptions, "rm_tool_options");
            this.view.AddSeparator();
            this.view.AddItem(this.cm.ResetPaletteLocation, "rm_reset_palette_location");
            addChild(this.view);
            this.language = new Menu();
            this.language.x = languaget.x;
            this.language.y = 22;
            this.language.visible = false;
            this.language.AddItem(function ()
            {
                ed.SetLanguage("en");
                return;
            }// end function
            , "English", false, "English");
            this.language.AddItem(function ()
            {
                ed.SetLanguage("zh-tw");
                return;
            }// end function
            , "繁体中文", false, "Traditional Chinese");
            this.language.AddItem(function ()
            {
                ed.SetLanguage("zh-cn");
                return;
            }// end function
            , "简体中文", false, "Simplified Chinese");
            this.language.AddItem(function ()
            {
                ed.SetLanguage("kr");
                return;
            }// end function
            , "한국어", false, "Korean");
            this.language.AddItem(function ()
            {
                ed.SetLanguage("jp");
                return;
            }// end function
            , "日本語", false, "Japanese");
            this.language.AddItem(function ()
            {
                ed.SetLanguage("th");
                return;
            }// end function
            , "ภาษาไทย", false, "Thai");
            this.language.AddItem(function ()
            {
                ed.SetLanguage("es");
                return;
            }// end function
            , "Español", false, "Spanish");
            this.language.AddItem(function ()
            {
                ed.SetLanguage("de");
                return;
            }// end function
            , "Deutsch", false, "German");
            this.language.AddItem(function ()
            {
                ed.SetLanguage("fr");
                return;
            }// end function
            , "Français", false, "French");
            this.language.AddItem(function ()
            {
                ed.SetLanguage("el");
                return;
            }// end function
            , "Ελληνικά", false, "Greek");
            this.language.AddItem(function ()
            {
                ed.SetLanguage("ar");
                return;
            }// end function
            , "العربية", false, "Arabic");
            this.language.AddItem(function ()
            {
                ed.SetLanguage("pt-br");
                return;
            }// end function
            , "Português do Brasil", false, "Portuguese");
            this.language.AddItem(function ()
            {
                ed.SetLanguage("ru");
                return;
            }// end function
            , "Русский", false, "Russian");
            this.language.AddItem(function ()
            {
                ed.SetLanguage("uk");
                return;
            }// end function
            , "Українська мова", false, "Ukrainian");
            this.language.AddItem(function ()
            {
                ed.SetLanguage("he");
                return;
            }// end function
            , "עִבְרִית", false, "Hebrew");
            this.language.AddItem(function ()
            {
                ed.SetLanguage("it");
                return;
            }// end function
            , "Italiano", false, "Italian");
            this.language.AddItem(function ()
            {
                ed.SetLanguage("ro");
                return;
            }// end function
            , "Română", false, "Romanian");
            this.language.AddItem(function ()
            {
                ed.SetLanguage("nl");
                return;
            }// end function
            , "Nederlands", false, "Dutch");
            this.language.AddItem(function ()
            {
                ed.SetLanguage("sv");
                return;
            }// end function
            , "Svenska", false, "Swedish");
            this.language.AddItem(function ()
            {
                ed.SetLanguage("dk");
                return;
            }// end function
            , "Dansk", false, "Danish");
            this.language.AddItem(function ()
            {
                ed.SetLanguage("sl");
                return;
            }// end function
            , "Slovenščina", false, "Slovenian");
            this.language.AddItem(function ()
            {
                ed.SetLanguage("cs");
                return;
            }// end function
            , "čeština", false, "Czech");
            this.language.AddItem(function ()
            {
                ed.SetLanguage("tr");
                return;
            }// end function
            , "Türkçe", false, "Turkish");
            this.language.AddItem(function ()
            {
                ed.SetLanguage("pl");
                return;
            }// end function
            , "Polski", false, "Polish");
            addChild(this.language);
            this.liping = new Menu();
            this.liping.x = lipingt.x;
            this.liping.y = 22;
            this.liping.visible = false;
            this.liping.AddItem(function ()
            {
                cm.OpenURL("http://www.ediy.com/zh-CN/topics/?act=view&id=2&uid=12");
                return;
            }// end function
            , "我的DIY生日礼物", true);
            this.liping.AddItem(function ()
            {
                cm.OpenURL("http://www.ediy.com/zh-CN/index.php?app=topics&act=view&id=4&uid=12");
                return;
            }// end function
            , "我的DIY情侣礼物", true);
            this.liping.AddItem(function ()
            {
                cm.OpenURL("http://www.ediy.com/zh-CN/index.php?app=topics&act=view&id=6&uid=12");
                return;
            }// end function
            , "我的DIY结婚礼物", true);
            this.liping.AddItem(this.cm.ShowAd, "rm_liping");
            addChild(this.liping);
            this.user = new Sprite();
            addChild(this.user);
            return;
        }// end function

        public function Resize() : void
        {
            this.bg.width = stage.stageWidth;
            this.user.x = stage.stageWidth - this.user.width - 20;
            return;
        }// end function

        public function SetUserDetails() : void
        {
            var name:*;
            var sep:*;
            var logout:*;
            var settings:*;
            var login:*;
            var register:*;
            while (this.user.numChildren > 0)
            {
                
                this.user.removeChildAt(0);
            }
            if (!U.IsParamTrue("locktarget"))
            {
                if (this.ed.user != null)
                {
                    name = new Text(this.ed.user.name, AppState.TextSize, 16777215);
                    name.y = 1;
                    name.x = 0;
                    this.user.addChild(name);
                    sep = new Text(" | ", AppState.TextSize, 16777215);
                    sep.y = 0;
                    sep.x = this.user.width;
                    this.user.addChild(sep);
                    logout = new TextLink(U.RM("rm_logout"), AppState.TextSize, 16777215);
                    logout.y = 1;
                    logout.x = this.user.width;
                    logout.addEventListener(MouseEvent.CLICK, this.cm.LogoutUser, false, 1, true);
                    this.user.addChild(logout);
                    sep = new Text(" | ", AppState.TextSize, 16777215);
                    sep.y = 0;
                    sep.x = this.user.width;
                    this.user.addChild(sep);
                    settings = new TextLink(U.RM("图层相册"), AppState.TextSize, 16777215);
                    settings.y = 1;
                    settings.x = this.user.width;
                    settings.addEventListener(MouseEvent.CLICK, function ()
            {
                cm.OpenImageLibrary(true);
                return;
            }// end function
            , false, true);
                    this.user.addChild(settings);
                }
                else
                {
                    login = new TextLink(U.RM("rm_login"), AppState.TextSize, 16777215);
                    login.y = 1;
                    login.x = this.user.width;
                    login.addEventListener(MouseEvent.CLICK, this.cm.Login, false, 1, true);
                    this.user.addChild(login);
                    sep = new Text(" | ", AppState.TextSize, 16777215);
                    sep.y = 0;
                    sep.x = this.user.width;
                    this.user.addChild(sep);
                    register = new TextLink(U.RM("rm_register"), AppState.TextSize, 16777215);
                    register.y = 1;
                    register.x = this.user.width;
                    register.addEventListener(MouseEvent.CLICK, this.cm.Register, false, 1, true);
                    this.user.addChild(register);
                }
            }
            this.Resize();
            return;
        }// end function

        private function MenuTitleMouseDown(event:MouseEvent) : void
        {
            if (!this.active)
            {
                this.active = true;
                this.SetMenu(event.currentTarget.name);
                stage.addEventListener(MouseEvent.MOUSE_DOWN, this.StageMouseDown, false, 0, true);
            }
            else
            {
                this.HideAll();
                this.active = false;
            }
            event.stopPropagation();
            return;
        }// end function

        private function MenuTitleMouseOver(event:MouseEvent) : void
        {
            if (this.active)
            {
                this.HideAll();
                this.SetMenu(event.currentTarget.name);
            }
            return;
        }// end function

        private function StageMouseDown(event:MouseEvent) : void
        {
            this.HideAll();
            this.active = false;
            if (stage != null)
            {
                stage.removeEventListener(MouseEvent.MOUSE_DOWN, this.StageMouseDown);
            }
            return;
        }// end function

        private function SetMenu(CanvasSize:String) : void
        {
            switch(CanvasSize)
            {
                case "file":
                {
                    this.file.visible = true;
                    break;
                }
                case "edit":
                {
                    this.edit.visible = true;
                    break;
                }
                case "image":
                {
                    this.image.visible = true;
                    break;
                }
                case "layer":
                {
                    this.layer.visible = true;
                    break;
                }
                case "adjustment":
                {
                    this.adjustment.visible = true;
                    break;
                }
                case "filter":
                {
                    this.filter.visible = true;
                    break;
                }
                case "view":
                {
                    this.view.visible = true;
                    break;
                }
                case "language":
                {
                    this.language.visible = true;
                    break;
                }
                case "liping":
                {
                    this.liping.visible = true;
                    break;
                }
                default:
                {
                    break;
                }
            }
            return;
        }// end function

        private function HideAll() : void
        {
            this.file.visible = false;
            this.edit.visible = false;
            this.image.visible = false;
            this.layer.visible = false;
            this.adjustment.visible = false;
            this.filter.visible = false;
            this.view.visible = false;
            this.language.visible = false;
            this.liping.visible = false;
            return;
        }// end function

    }
}
